export default {
  namespaced: true,
  state: {
    // 参数列表动态
    manyList: [],
    // 参数列表静态
    onlyList: [],
    id: ''
  },
  mutations: {
    putManyList (state, data) {
      state.manyList = data
    },
    putOnlyList (state, data) {
      state.onlyList = data
    },
    putListItem (state, data) {
      // console.log(data)
      if (data[0]) {
        state.manyList[data[1]].attr_vals = data[2]
      } else {
        state.onlyList[data[1]].attr_vals = data[2]
      }
    },
    putListItemName (state, data) {
      // console.log(data)
      if (data[0]) {
        state.manyList[data[1]].attr_name = data[2]
      } else {
        state.onlyList[data[1]].attr_name = data[2]
      }
    },
    putId (state, id) {
      state.id = id
    },
    deleteParamsList (state, data) {
      if (data[0]) {
        state.manyList.splice(data[1], 1)
      } else {
        state.onlyList.splice(data[1], 1)
      }
    }
  },
  actions: {}
}
